<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>问题详情</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="keywords" content="fly,layui,前端社区">
    <meta name="description" content="">
    <link rel="stylesheet" href="__BBS_Module__/layui/css/layui.css">
    <link rel="stylesheet" href="__BBS_Module__/css/global.css">
    <script src="/public/jquery/jquery-3.3.1.min.js"></script>
    <script src="/public/layer/layer.js"></script>
    <link rel="stylesheet" href="http://www.pcbeta.com/data/cache/style_6_forum_viewthread.css?hAX">
    <script src="__BBS_Module__/layui/layui.js"></script>
    <script charset="utf-8" src="__BBS_Module__/kindeditor/kindeditor-all.js"></script>
    <script charset="utf-8" src="__BBS_Module__/kindeditor/lang/zh-CN.js"></script>
    <style type="text/css" rel="stylesheet">
        form {
            margin: 0;
        }

        .mod {
            display: flex;
            align-items: center;
            /*垂直居中*/
        }

        .editor {
            margin-top: 5px;
            margin-bottom: 5px;
        }
    </style>
    <link rel="stylesheet" type="text/css" href="/public/bbs/readarticle/style_6_forum_viewthread.css">
    <link rel="stylesheet" type="text/css" href="/public/bbs/readarticle/1.css">
    <link rel="stylesheet" href="/public/bbs/readarticle/inserthtml.com.radios.css">
    <link rel="stylesheet" href="/public/bbs/readarticle/style.css">


</head>

<body>
    {$head}
    <div class="global main layui-clear">
        <div class="global wrap">
            <div class="global content detail">
                <div class="global fly-panel detail-box">
                    <h1>{$article.title}</h1>
                    <div class="global fly-tip fly-detail-hint" data-id="">
                        <span class="global fly-tip-stick">置顶帖</span>
                        <span class="global jie-admin">
                            <a>点击置顶</a>
                        </span>
                        <span class="global layui-btn layui-btn-mini jie-admin">
                            <a>取消置顶</a>
                        </span>
                        {if condition="$me.id == $article.user_id"}
                        <span onclick="del()" class="global jie-admin" type="del" style="margin-left: 20px;">
                            <a>删除该帖</a>
                        </span>
                        <script>
                            function del() {
                                $.ajax({
                                type: "POST",
                                url: '{:url("bbs/readarticle/del_article")}',
                                data: {
                                    'time':'{:rsa_encode(time())}',
                                    '{:rsa_encode(time())}':'{:rsa_encode("$get_id")}',
                                },
                                dataType: "JSON",
                                success: function (response) {
                                    if (response.code == 0) {
                                        alert('删除成功');
                                        location.reload();
                                    }else{
                                        alert(response.msg)
                                    }
                                }
                            });
                            }
                        </script>
                        {/if}
                        <div class="global fly-list-hint">
                            <i class="global iconfont" title="回答">&#xe60c;</i> {:count($comment)}
                        </div>
                    </div>
                    <div class="global detail-about">
                        <a class="global jie-user"> <img src="{$user_info.head_src}" alt="头像"> <cite>
                                {if condition="$article.nickname"}
                                <i>{$article.nickname}</i>
                                {else\}
                                <i>{$article.user_name}</i>
                                {/if}
                                <em>{$article.release_time} 发布</em> </cite> </a>
                        <div class="global detail-hits" data-id="{{rows.id}}">
                            <span class="global layui-btn layui-btn-mini jie-admin"><a href="#">已完帖，无法编辑</a> </span> <span
                                class="global layui-btn layui-btn-mini jie-admin" type="collect" data-type="add"> <a
                                    id="collectPost">收藏</a> </span> <span
                                class="global layui-btn layui-btn-mini jie-admin  layui-btn-danger" type="collect"
                                data-type="add"> <a>取消收藏</a> </span>

                        </div>
                    </div>
                    <div class="global detail-body photos" style="margin-bottom: 20px;">
                        <p>{$article.content}</p>
                    </div>
                </div>
                <div class="global fly-panel detail-box" style="padding-top: 0;">
                    <ul class="global jieda photos" id="comment">

                        {if condition="$comment"}

                        {volist name='comment' id='vo' key='key'}
                        {if condition="$vo.father"}

                        <div style=" background: rgb(237, 251, 255)" class="global quote">
                            <blockquote>
                                <font size="2">
                                    <font color="#999999">
                                        {$vo.father.user_name} 发表于 {$vo.father.comments_time}
                                    </font>
                                </font>
                                <li>
                                    <span style="float: left;">
                                        {$vo.father.comments_body}
                                    </span>
                                    <i class="global iconfont icon-floor-son" style="float: right;"
                                        title="{$vo.comment_me_id}F">{$vo.father.comment_me_id}F</i>
                                </li>
                            </blockquote>
                        </div>

                        <div>
                            <li>
                                <div style="margin:auto;width: 90%;">
                                    <div class="global detail-about detail-about-reply">
                                        <a class="global jie-user"> <img src="{$vo.head_src}" alt=""> <cite>
                                                {if condition="$vo.nickname"}
                                                <i>{$vo.nickname}</i>
                                                {else\}
                                                <i>{$vo.user_name}</i>
                                                {/if}
                                                {if condition="$me.id == $article.user_id"}
                                                <em style="color:rgb(255, 0, 179)">
                                                    我自己
                                                </em>
                                                {/if}
                                                {if condition="$vo.id == $article.user_id"}
                                                <em style="color:#FF9E3F">
                                                    楼主
                                                </em>
                                                {/if}
                                            </cite>
                                        </a>
                                        <div class="global detail-hits">
                                            <span>{$vo.comments_time}</span>
                                        </div>
                                        <i class="global iconfont icon-floor" title="最佳答案">{$key}F</i>
                                    </div>
                                    <div class="global detail-body jieda-body">
                                        <p>{$vo.comments_body}</p>
                                    </div>
                                </div>
                                <div class="global jieda-reply">
                                    <span class="global jieda-zan" type="zan"><i
                                            class="global iconfont icon-zan"></i><em>{$vo.praise}</em>
                                    </span>
                                    {if condition="($vo.start == 0) OR ($article.user_id == $me.id ) AND ($vo.start !=
                                    1)"}
                                    <!-- <div class="global jieda-admin">
                                        <span type="del"><a href="#"
                                                class="global layui-btn layui-btn-danger layui-btn-small">删除</a></span>
                                        <span class="global jieda-accept" type="accept">
                                            <a href="#" class="global layui-btn  layui-btn-small">采纳</a></span>
                                    </div> -->
                                    {if condition="$me.id"}
                                    <div class="global jieda-admin">
                                        <span onclick="Reply('{$vo.comments_id}')" type="del"><a
                                                class="global layui-btn layui-btn-danger layui-btn-small">回复</a></span>
                                    </div>
                                    {/if}
                                    {/if}
                                </div>
                            </li>
                        </div>
                        {else\}
                        <li data-id="13">
                            <div class="global detail-about detail-about-reply">
                                <a class="global jie-user"> <img src="{$vo.head_src}" alt=""> <cite>
                                        {if condition="$vo.nickname"}
                                        <i>{$vo.nickname}</i>
                                        {else\}
                                        <i>{$vo.user_name}</i>
                                        {/if}
                                        {if condition="$me.id == $vo.user_id"}
                                        <em style="color:rgb(255, 0, 179)">
                                            我自己
                                        </em>
                                        {/if}
                                        {if condition="$vo.id == $article.user_id"}
                                        <em style="color:#FF9E3F">
                                            楼主
                                        </em>
                                        {/if}

                                    </cite>
                                </a>
                                <div class="global detail-hits">
                                    <span>{$vo.comments_time}</span>
                                </div>
                                <i class="global iconfont icon-floor" title="最佳答案">{$key}F</i>
                            </div>
                            <div class="global detail-body jieda-body">
                                <p>{$vo.comments_body}</p>
                            </div>
                            <div class="global jieda-reply">
                                {if condition="($vo.start == 0) OR ($article.user_id == $me.id )"}

                                <span class="global jieda-zan" type="zan"><i
                                        class="global iconfont icon-zan"></i><em>{$vo.praise}</em>
                                </span>
                                <!-- <div class="global jieda-admin">
                                    <span type="del"><a href="#"
                                            class="global layui-btn layui-btn-danger layui-btn-small">删除</a></span>
                                    <span class="global jieda-accept" type="accept">
                                        <a href="#" class="global layui-btn  layui-btn-small">采纳</a></span>
                                </div> -->
                                {if condition="$me.id"}
                                <div class="global jieda-admin">
                                    <span onclick="Reply('{$vo.comments_id}')" type="del"><a
                                            class="global layui-btn layui-btn-danger layui-btn-small">回复</a></span>
                                </div>
                                {/if}
                                {/if}

                            </div>
                        </li>
                        {/if}
                        {/volist}
                        {else \}
                        <li class="global fly-none">没有任何回答</li>
                        {/if}
                    </ul>
                    <span id="toName" style="color: blue">
                        @ {if condition="$article.nickname"}
                        <i>{$article.nickname}</i>
                        {else\}
                        <i>{$article.user_name}</i>
                        {/if}(楼主)
                    </span>
                    <div class="global layui-form layui-form-pane">
                        <div class="global layui-form-item layui-form-text">
                            <div class="global layui-input-block">
                                <textarea id="editor_id" name="content"
                                    placeholder="{$web_settings['bbs_readarticle_comment_text']}"
                                    class="global layui-textarea fly-editor" style="height: 150px;"
                                    style="width:700px;height:300px;"
                                    placeholder="啊啊">{$web_settings['bbs_readarticle_comment_text']}</textarea>
                            </div>
                        </div>
                        <div class="global layui-form-item">
                            <div style='float: left;'>
                                <button class="global layui-btn" id="Release" lay-filter="*" lay-submit>提交评论</button>
                            </div>
                            <div class="global mod" style='float: right;'>
                                <input class='global checkbox' type="checkbox" value='0' id="checkbox-11-1" /><label
                                    style='font-size: 62.5%;' for="checkbox-11-1"></label>
                                仅自己/楼主可见
                                <input class='global checkbox' type="checkbox" value='0' id="checkbox-11-2" /><label
                                    style='font-size: 62.5%;' for="checkbox-11-2"></label>
                                回复我邮件通知我
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="global edge">
            <dl class="global fly-panel fly-list-one">
                <dt class="global fly-panel-title">最近热帖</dt>
                <dd>
                    <a>使用 layui 秒搭后台大布局（基本结构）</a> <span><i class="global iconfont">&#xe60b;</i> 6087</span>
                </dd>
                <dd>
                    <a>Java实现LayIM后端的核心代码</a> <span><i class="global iconfont">&#xe60b;</i>
                        767</span>
                </dd>
                <dd>
                    <a>使用 layui 秒搭后台大布局（基本结构）</a> <span><i class="global iconfont">&#xe60b;</i> 6087</span>
                </dd>
                <dd>
                    <a>Java实现LayIM后端的核心代码</a> <span><i class="global iconfont">&#xe60b;</i>
                        767</span>
                </dd>
                <dd>
                    <a>使用 layui 秒搭后台大布局（基本结构）</a> <span><i class="global iconfont">&#xe60b;</i> 6087</span>
                </dd>
                <dd>
                    <a>Java实现LayIM后端的核心代码</a> <span><i class="global iconfont">&#xe60b;</i>
                        767</span>
                </dd>
                <dd>
                    <a>使用 layui 秒搭后台大布局（基本结构）</a> <span><i class="global iconfont">&#xe60b;</i> 6087</span>
                </dd>
                <dd>
                    <a>Java实现LayIM后端的核心代码</a> <span><i class="global iconfont">&#xe60b;</i>
                        767</span>
                </dd>
            </dl>

            <dl class="global fly-panel fly-list-one">
                <dt class="global fly-panel-title">近期热议</dt>
                <dd>
                    <a>使用 layui 秒搭后台大布局之基本结构</a> <span><i class="global iconfont">&#xe60c;</i> 96</span>
                </dd>
                <dd>
                    <a>使用 layui 秒搭后台大布局之基本结构</a> <span><i class="global iconfont">&#xe60c;</i> 96</span>
                </dd>
                <dd>
                    <a>使用 layui 秒搭后台大布局之基本结构</a> <span><i class="global iconfont">&#xe60c;</i> 96</span>
                </dd>
                <dd>
                    <a>使用 layui 秒搭后台大布局之基本结构</a> <span><i class="global iconfont">&#xe60c;</i> 96</span>
                </dd>
                <dd>
                    <a>使用 layui 秒搭后台大布局之基本结构</a> <span><i class="global iconfont">&#xe60c;</i> 96</span>
                </dd>
                <dd>
                    <a>使用 layui 秒搭后台大布局之基本结构</a> <span><i class="global iconfont">&#xe60c;</i> 96</span>
                </dd>
                <dd>
                    <a>使用 layui 秒搭后台大布局之基本结构</a> <span><i class="global iconfont">&#xe60c;</i> 96</span>
                </dd>
                <dd>
                    <a>使用 layui 秒搭后台大布局之基本结构</a> <span><i class="global iconfont">&#xe60c;</i> 96</span>
                </dd>
            </dl>
        </div>
    </div>
    <script type="text/javascript">
        var editor;
        KindEditor.ready(function (K) {
            editor = K.create('#editor_id', {
                resizeType: 2,
                uploadJson: '{:url("upload/index/image_upload")}', // 相对于当前页面的路径
                newlineTag: 'br', //回车换行br|p
                afterBlur: function () {
                    editor.sync();
                    if (editor.html() == '<br />' || editor.html() == '') {
                        editor.html("{$web_settings['bbs_readarticle_comment_text']}");
                        $("#qstContent").contents().find(".ke-content").css("color", "red");
                    }
                },
                afterFocus: function () {
                    if (editor.html() == "{$web_settings['bbs_readarticle_comment_text']}") {
                        editor.html('');
                        // 输入文字变为黑色
                        $("#qstContent").contents().find(".ke-content").css("color", "#fff");
                    }
                },
            }); {
                $editor_readonly
            } //动态加载是否禁用ke编辑器
        });
        $('#Release').click(function (e) {
            index = layer.msg('加载中', {
                icon: 16,
                shade: 0.01,
                time: 9999999999,
            });
            e.preventDefault();
            html = $('#editor_id').val();
            $.ajax({
                type: "POST",
                url: "{:url('bbs/readarticle/comment_release')}",
                data: {
                    id: '{$get_id}',
                    RandStr: '{$bbs_ReadArticle_RandStr}',
                    comment: html,
                    // title: encodeURIComponent(rsa_encode('{$article["title"]}', '{$web_settings.rsa_public}')),
                    title: '{:rsa_encode($article["title"])}',
                    email: '{:rsa_encode(\'$me["email"]\')}',
                    Home_id: '{:rsa_encode($article.user_id)}',
                    son: false,
                    checkbox: $('#checkbox-11-1').val(),
                },
                dataType: "json",
                success: function (response) {
                    if (response.code == 1) {
                        $('#comment').append(response.msg);
                        layer.close(index);
                    } else {
                        layer.tips('发生意外错误错题提示/信息' + response.msg + '请联系管理员', '#Release', {
                            tips: [1, '#3595CC'],
                            time: 4000
                        });
                        return;
                    }
                }
            });
        });
        $('#checkbox-11-1').click(function (e) {
            if ($('#checkbox-11-1').val() == 2) {
                $('#checkbox-11-1').val(0);
            } else {
                $('#checkbox-11-1').val(2);
            }

        });
        $('#checkbox-11-2').click(function (e) {
            // if ($('#checkbox-11-2').val() == 2) {
            //     $('#checkbox-11-2').val(0);
            // } else {
            //     $('#checkbox-11-2').val(2);
            // }
            alert('待完善');
        });

        function Reply(id) {
            layer.open({
                type: 2,
                area: ['700px', '450px'],
                fixed: false, //不固定
                maxmin: true,
                content: '{:url("bbs/readarticle/reply_son")}?article_id={$get_id}&comment_id=' + id
            });
        }
    </script>
</body>

</html>